home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-17
/
cfg10.zip
/
CFG.DOC
< prev
next >
Wrap
Text File
|
1993-02-01
|
25KB
|
639 lines
CFG.SYS Version 1.0
Mark Treadwell
1247 Foursome Lane
Virginia Beach, Virginia 23455-6819
Voice: (804) 497-3281
CompuServe 73700,3344
Copyright (c) 1992 Mark Treadwell
All Rights Reserved
CFG.SYS is a system device driver that provides multiple utilities for use
during CONFIG.SYS execution. The program does not remain resident and
releases all memory on termination. Suggestions for additions to the
CFG.SYS collection are welcome. Contact me via CompuServe Mail or in the
CompuServe Forum section corresponding to the library CFG.SYS was downloaded
from.
───────────────────────────────────────────────────────────────────────────
TO USE
───────────────────────────────────────────────────────────────────────────
Syntax DEVICE=[drive:][path]CFG.SYS CommandName [Options]
Parameter [drive:][path]
Specifies the location of the CFG.SYS file.
CommandName
The list of valid CommandNames is given in the COMMANDS
section below. The CommandNames must be spelled exactly
as shown.
[Options]
CommandName related options are detailed below.
Switches None.
Example DEVICE=C:\DOS\START\CFG.SYS AltPause
Help For help from the DOS command line, "TYPE CFG.SYS" will display
an abbreviated command summary.
Notes Case does not matter in CONFIG.SYS. DOS capitalizes everything
in the file during its preliminary scan. This is pertinent when
using the Echo or EchoPause commands.
PC Magazine PATCH Utility Variables
───────────────────────────────────
[TEXT] : Carriage Return/Line Feed Insert Character
: Lower Case Toggle Character
[NUMBER] : Tone Low Point Frequency
: Tone High Point Frequency
: Tone Step Value
: Tone Duration
───────────────────────────────────────────────────────────────────────────
COMMANDS
───────────────────────────────────────────────────────────────────────────
All command line formats and examples given below should be understood to
begin with "DEVICE=[drive:][path]CFG.SYS " in the CONFIG.SYS file.
══════════════════
Beep Beeps the speaker.
Command line format:
Beep
Writes an ASCII 7 to the screen to trigger the BIOS beep sound
routine.
══════════════════
Cls Clears the screen with a choice of foreground and background
colors.
Command line format:
Cls foreground [on] background
The following colors may be used:
- Black - Grey
- Blue - Bright Blue
- Green - Bright Green
- Cyan - Bright Cyan
- Red - Bright Red
- Magenta - Bright Magenta
- Yellow - Bright Yellow
- White - Bright White
If any color in the right column is chosen for a background, the
video display is reprogrammed to show intense background colors
vice blinking text. Some programs may subsequently reset this.
Intense background colors are not available if ANSI.SYS is
installed.
If ANSI.SYS is not installed, these colors are not permanent and
the DOS standard grey on black may begin to scroll depending on
the behavior of the video adapter. If ANSI.SYS is installed
before CFG.SYS is run, CFG.SYS will detect it and use ANSI
escape sequences to change system colors.
Note that the "Bright ..." colors are scanned on the command
line with only a single space between the words. This was done
to simplify the logic of the routine. Otherwise, CFG.SYS will
accept any number of spaces between words.
If no colors a given or if an invalid combination is used, the
current screen colors are used. No error message is generated
for improper format or spelling.
This function is loosely based on two programs: the CLS.SYS
driver written by William R. Peate [76525,2366] and uploaded to
the CompuServe ZiffNet ZNT:TIPS Forum Library 16 (Gen Utils) on
10 April 1992 and PC Magazine's BATCHMAN.COM written by Charles
Petzold. The command line color scanning and ANSI code was
written by the author.
══════════════════
ComHide Hides and restores the serial port base addresses.
Command line format:
ComHide H|R
The "H" option hides the serial port base addresses. The "R"
option restores them. One of the two must be used. Error
messages are displayed if the routine fails.
ComHide hides the serial port base addresses by copying them to
another location in memory when the "H" option is used. On
restoration with the "R" option, ComHide verifies the signature
and checksum stored with the port address to ensure that they
were not accidently over written while hidden. ComHide then
copies the base addresses back to their normal location.
The default location for the hidden data is 7001:0000. This is
below the 512 Kb boundary in the event that the machine only has
that much base memory available, and high enough to keep it from
being over-written during execution of other device drivers
while the data is hidden.
Example command lines:
CFG.SYS ComHide H
COM.SYS
CFG.SYS ComHide R
This function was adapted from the LptHide function.
══════════════════
ComSwap Swaps the serial base port addresses for the two serial ports
specified.
Command line format:
ComSwap a b
where a and b are the numbers of the serial ports to be swapped.
Valid numbers are 1, 2, 3 and 4. An error message will be given
if one of the ports is missing or invalid.
ComSwap switches the two ports as far as DOS is concerned. This
is useful if you need to shift the ports around prior to loading
software device drivers.
Example command line:
CFG.SYS ComSwap 4 2
This function was written by the author.
══════════════════
Echo Sends a comment line to the screen.
Command line format:
Echo [String to be displayed]
Since DOS capitalizes everything on the CONFIG.SYS command line,
a carat "^" is used as the default character to toggle between
upper and lower case for the displayed string. If a carat is
desired on the displayed line, two ("^^") should be used on the
input line. Used without text, Echo outputs a carriage
return/line feed sequence.
A tilde "~" is the default character for insertion of a carriage
return/line feed sequence in the displayed line.
Example command line:
CFG.SYS Echo S^tart ^DEVICE ^section...~
This command line would display "Start DEVICE section..." with
two trailing carriage return/line feeds.
This function was adapted and expanded from COMMENT.SYS written
by Skip Gilbrech [71445,534] on 05/19/85.
══════════════════
EchoPause Suspends execution after printing a prompt message on the screen
that is specified on the command line.
Command line format:
EchoPause [String to be displayed]
Pressing any key resumes execution. Command line text should be
formatted as in the Echo command. Use KeyPause for optional
pausing.
This function was adapted by the author from the Echo and Pause
commands.
══════════════════
EGA25 Sets a 25 line color EGA screen.
Command line format:
EGA25
Performs a mode 3 reset of the display adapter. This works on
EGA in a display independent way.
This function was written by the author.
══════════════════
EGA43 Sets a 43 line EGA screen.
Command line format:
EGA43
Forces the use of the display adapter's internal 8x8 font.
Interrupt 10H Function 11H Subfunction 12H performs an adapter
mode reset when it executes. This works on EGA in a display
independent way.
This function was written by the author.
══════════════════
KeyPause Suspends execution if the Shift, Alt or Ctrl keys are pressed.
Command line format:
KeyPause
One of the listed keys must be held down before program
execution. Execution resumes once the key is released. Use
Pause for prompted pausing.
This function was adapted from a debug script in message #143888
in the CompuServe ZiffNet ZNT:TIPS Forum Section 4
(User-to-User) from Neil Rubenking [72241,50] to Oscar (no last
name) [75040,33] on 8 July 1992. Neil uploaded it as
ALTPAUSE.SYS, even though it worked for all shift keys. Neil
has had the driver for a while and was not sure where or when he
originally got it.
══════════════════
LptHide Hides and restores the printer port base addresses.
Command line format:
LptHide H|R
The "H" option hides the printer port base addresses. The "R"
option restores them. One of the two must be used. Error
messages are displayed if the routine fails.
The specific driver this was written for is the Iomega Bernoulli
Box RCD.SYS driver. During RCD.SYS initialization, it
interrogates the printer ports to determine if there are any
parallel port Bernoulli Boxes installed. Unfortunately, some
printers respond to this interrogation by printing the
interrogation sequence.
LptHide hides the printer port base addresses by copying them to
another location in memory when the "H" command is used. On
restoration with the "R" command, LptHide verifies the signature
and checksum stored with the port address to ensure that they
were not accidently over written during RCD.SYS execution.
LptHide then copies the base addresses back to their normal
location.
The default location for the hidden data is 7000:0000. This is
below the 512 Kb boundary in the event that the machine only has
that much base memory available, and high enough to keep it from
being over-written during execution of other device drivers
while the data is hidden.
Example command lines:
CFG.SYS LptHide H
RCD.SYS /M0
CFG.SYS LptHide Restore
This function was adapted and expanded from the device driver
LPTHIDE.SYS uploaded as LPTHID.SYS to CompuServe CIS:PCVENE
Library 3 (Iomega Corp.) on 13 March 1992 by Ronald Routh
[75300,2511].
══════════════════
LptSwap Swaps the printer base port addresses for the two printer ports
specified.
Command line format:
LptSwap a b
where a and b are the numbers of the printer ports to be
swapped. Valid numbers are 1, 2 and 3. An error message will
be given if one of the ports is missing or invalid.
LptSwap switches the two ports as far as DOS is concerned. This
is useful if you need to shift the printer ports around and are
loading a software print buffer as a device driver.
Example command line:
CFG.SYS LptSwap 1 3
This function was written by the author.
══════════════════
Mono Sets a 25 line monochrome screen.
Command line format:
Mono
Performs a mode 7 reset of the display adapter. This works in a
display independent way. Use this function only if a monochrome
monitor is installed.
This function was written by the author.
══════════════════
Pause Suspends execution after printing a prompt message on the
screen.
Command line format:
Pause
Pressing any key resumes execution. Use KeyPause for optional
pausing. The standard prompt is "CFG.SYS Pause - Press any key
to continue . . .".
This function was adapted from a Debug script for PAUSE.SYS
written by Jeff Prosise and published in the Tutor section of
the 30 June 1992 issue of PC Magazine.
══════════════════
Tones Programs the system's speaker port to emit a rising (Upward) or
falling (Downward) series of tones.
Command line format:
Tones U|D
A missing or incorrect command line argument will abort the
program with an error message.
This function is based on the sound routines contained in the
ALLKEYS.COM program by Robert L. Morton as published in the 28
June 1988 issue of PC Magazine.
══════════════════
VGA25 Sets a 25 line color VGA screen.
Command line format:
VGA25
Performs a mode 3 reset of the display adapter. This works on
VGA in a display independent way.
This function was written by the author.
══════════════════
VGA43 Sets a 43 line VGA screen.
Command line format:
VGA43
Forces the use of the display adapter's internal 8x14 font.
Interrupt 10H Function 11H Subfunction 11H performs an adapter
mode reset when it executes. This works on VGA in a display
independent way.
This function was written by the author.
══════════════════
VGA50 Sets a 50 line VGA screen.
Command line format:
VGA50
Forces the use of the display adapter's internal 8x8 font.
Interrupt 10H Function 11H Subfunction 12H performs an adapter
mode reset when it executes. This works on VGA in a display
independent way.
This function was written by the author.
══════════════════
WaitFor Delays program execution for the number of minutes and seconds
given on the command line.
Command line format:
WaitFor [m:]s
Where m is the delay time in minutes and s is in seconds. If a
single number is on the command line, it is assumed to be
seconds. The default is one second.
Pressing any key during the wait period will immediately cancel
the wait.
This function is adapted from PC Magazine's BATCHMAN.COM written
by Charles Petzold.
───────────────────────────────────────────────────────────────────────────
DISCLAIMER - RESTRICTIONS
───────────────────────────────────────────────────────────────────────────
CFG.SYS is freeware, or what is known as "zero-cost shareware". CFG.SYS is
not what is generally called "public domain" software because the author
retains the copyright. However, the CFG.SYS package can be copied, used and
distributed freely as long as CFG.SYS, its documentation file (CFG.DOC), and
associated ZIF file are not altered and are distributed together, preferably
in the original unchanged ZIP file.
CFG.SYS can be included in shareware packages as long as both CFG.SYS and
its related files are included in the shareware package. If you have
received CFG.SYS as part of some larger shareware package, please be aware
that you may freely use, copy and distribute CFG.SYS without paying a fee
for, or registering, the larger package.
CFG.SYS is supplied as is. The author disclaims all warranties, expressed
or implied, including, without limitation, the warranties of merchantability
and of fitness for any purpose. The author assumes no liability for
damages, direct or consequential, which may result from the use of CFG.SYS.
CFG.SYS should work for all DOS versions from 2.0 upward. It has been
specifically tested only on DOS 5.0. I would appreciate confirmation of
satisfactory operation on older versions of DOS.
If you find CFG.SYS useful, I would like to know. I would appreciate a
short note via US Mail or CompuServe Mail telling me what you like or
dislike about CFG.SYS. If you need other functions or output, please
contact me.
I will upload the most recent version of CFG.SYS to various forums on
CompuServe and ZiffNet under the file name "CFG.ZIP". If the file does not
appear with my PPN, it may not be the most recent upload.
───────────────────────────────────────────────────────────────────────────
ACKNOWLEDGEMENTS
───────────────────────────────────────────────────────────────────────────
My thanks and recognition goes to the authors listed above for their
original versions of the utilities presented here. A special tip of the hat
goes to Rod Pullman [CompuServe 76226,3120] for his very useful DEVICE.COM
utility. DEVICE loads DOS character device drivers subsequent to system
boot. It also works great to test nonresident character device drivers like
CFG. Without it, testing and debugging CFG.SYS would have been too hard to
contemplate.
───────────────────────────────────────────────────────────────────────────
ERROR MESSAGES
───────────────────────────────────────────────────────────────────────────
CFG.SYS ERROR - Invalid command
───
Issued if specified CommandName is incorrect or
missing.
CFG.SYS ComHide ERROR - No option found. 'H' or 'R' is required.
───
Issued if CommandName Option does not begin with the
correct letter. CFG.SYS only checks the first
character after the CommandName, the rest of the
line is ignored.
CFG.SYS ComHide ERROR - Hidden ports already present.
───
Issued if Hide is run twice in succession without a
Restore in between. A second Hide action would
permanently erase the base port addresses.
CFG.SYS ComHide ERROR - Could not locate hidden ports.
───
Issued if the signature is missing from the upper
memory hidden storage location. This could be due
to the area having been over-written or due to a
Restore being run without a preliminary Hide
operation.
CFG.SYS ComHide ERROR - Checksum invalid, ports not restored.
───
The checksum stored with the hidden ports shows that
the data has been changed since it was written,
probably due to being over-written.
CFG.SYS ComSwap ERROR - Missing or invalid port.
───
Issued if only one port is given on the command line
or if the port requested is other than 1, 2, 3 or 4.
CFG.SYS ComSwap ERROR - Cannot swap the same port.
───
Issued if the ports requested are the same.
CFG.SYS LptHide ERROR - No option found. 'H' or 'R' is required.
───
See ComHide description.
CFG.SYS LptHide ERROR - Hidden ports already present.
───
See ComHide description.
CFG.SYS LptHide ERROR - Could not locate hidden ports.
───
See ComHide description.
CFG.SYS LptHide ERROR - Checksum invalid, ports not restored.
───
See ComHide description.
CFG.SYS LptSwap ERROR - Missing or invalid port.
───
See ComSwap description.
CFG.SYS LptSwap ERROR - Cannot swap the same port.
───
See ComSwap description.
CFG.SYS Sound ERROR - Missing or incorrect command option.
───
Issued if CommandName Option is missing or does not
begin with the correct letter. CFG.SYS only checks
the first character after the CommandName, the rest
of the line is ignored.
CFG.SYS WaitFor ERROR - Missing or incorrect delay value.
───
Issued if CommandName Option is missing or does not
begin with a number. CFG.SYS only checks for a ':'
between the minutes and seconds. Any other
character will cause the minutes value to be treated
as seconds and the seconds value to be ignored.
────────────────────────────────────────────────────────────────────────────
REVISION HISTORY
────────────────────────────────────────────────────────────────────────────
Version 1.0 --- 28 August 1992
First version. Supports Beep, Cls, ComHide, ComSwap, Echo, EchoPause,
EGA43, KeyPause, LptHide, LptSwap, Pause, Tones, VGA43, VGA50 and
WaitFor commands.
────────────────────────────────────────────────────────────────────────────
DISCUSSION
────────────────────────────────────────────────────────────────────────────
Many utilities exist for use from the command line. When I added
Qualitas' BlueMax 6.0 to my system, what was once a relatively short boot
display became quite a protracted affair. I wanted to neaten and add color
to the device driver installation phase as well as add messages and optional
pauses. I foresaw my disk becoming overrun by numerous small device
drivers, so I wrote the basic CFG.SYS shell handler and then started looking
around for useful utilities.
CFG.SYS is executed during the device driver installation phase of system
boot. It does not remain resident in memory and may be run multiple times
in CONFIG.SYS.
CFG.SYS sets up its own 512 byte stack to avoid overflowing the DOS stack
during operation. The program then moves the command line from the system
buffer to a local buffer for parsing. The CommandName is scanned and the
appropriate function is executed. The function is responsible for any
additional command line parsing.
Upon completion of the function, the command handler regains control and
performs the final clean-up processing required by DOS for termination of
the driver. The DOS stack in use at program entry is restored and CFG.SYS
ends with a Far Return to DOS.
General parsing allows any of the standard DOS delimiter characters to be
ignored. With the exception of the bright Cls colors noted above, the
number of spaces between command line words does not matter.